package com.muse.sentinel.handler;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.alibaba.csp.sentinel.adapter.servlet.callback.UrlCleaner;

/**
 * URL资源清洗
 */
@Service
public class MuseUrlCleaner implements UrlCleaner {
    @Override
    public String clean(String s) {
        if (StringUtils.isBlank(s)) {
            return s;
        }

        if (s.startsWith("/urlCleaner/")) {
            return "/urlCleaner/*";
        }
        return s;
    }
}
